import request from '@/utils/request.js'

const productApi = {
    list(productQuery) {
        return request.get('/product/list', {params: productQuery})
    },
    deleteById(id) {
        return request.delete(`/product/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete(`/product/deleteAll/${ids}`)
    },
    add(product) {
        //product以JSON形式传递到后台
        return request.post('/product/add', product)
    },
    selectById(id) {
        return request.get(`/product/selectById/${id}`)
    },
    update(product) {
        return request.put('/product/update', product)
    },
    updateStatus(id, status) {
        return request.put(`/product/updateStatus/${id}/${status}`)
    }
}

export default productApi
